package com.qingcloud.fexecutor.pojo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.List;

public class WebProjectDTO implements Serializable {

    @Data
    @ApiModel("分页数据对象")
    public static class PageDTO implements Serializable {

        @ApiModelProperty(value = "ID")
        private Integer id;

        @ApiModelProperty(value = "DEV_APP_ID")
        private Integer devAppId;


        @ApiModelProperty(value = "项目类型 1-前端应用 2-后端应用 3-APP应用")
        private Integer projectType;

        @ApiModelProperty(value = "应用类型 1-单页面应用 2-多页面应用")
        private Integer appType;

        @ApiModelProperty(value = "封面图片")
        private String coverUrl;

        @ApiModelProperty(value = "名称")
        private String name;

        @ApiModelProperty(value = "名称 1-开发中 2-已提交 3-已发布")
        private Integer state;

        @ApiModelProperty(value = "发布的应用编号")
        private Integer pubId;

        @ApiModelProperty(value = "商城编号")
        private Integer mallId;

        @ApiModelProperty(value = "已发布应用的访问地址")
        private String appUrl;

        @ApiModelProperty(value = "应用描述")
        private String appDesc;

        @ApiModelProperty(value = "应用标签")
        private String tags;

        @ApiModelProperty(value = "应用分类编码")
        private Integer category;

        @ApiModelProperty(value = "分类描述")
        private String categoryDesc;

        @ApiModelProperty(value = "安装次数")
        private Integer useTimes;

        @ApiModelProperty(value = "创建人")
        private String createUser;

        @ApiModelProperty(value = "发布商城时间")
        private String shopTime;

        @ApiModelProperty(value = "创建时间")
        private String createTime;

    }

    @Data
    @ApiModel("明细数据对象")
    public static class DetailDTO implements Serializable {

        @ApiModelProperty(value = "ID")
        private Integer id;

        @ApiModelProperty(value = "应用类型 1-单页面应用 2-多页面应用")
        private Integer appType;

        @ApiModelProperty(value = "发布应用访问地址")
        private String appUrl;

        @ApiModelProperty(value = "源码ID")
        private Integer sourceId;

        @ApiModelProperty(value = "源码")
        private String source;

        @ApiModelProperty(value = "封面图片")
        private String coverUrl;

        @ApiModelProperty(value = "名称")
        private String name;

        @ApiModelProperty(value = "名称 1-开发中 2-已提交 3-已发布")
        private Integer state;

        @ApiModelProperty(value = "是否模板 0-不是 1-是")
        private Integer isTemplate;

        @ApiModelProperty(value = "应用介绍")
        private String appDesc;

        @ApiModelProperty(value = "应用标签")
        private String tags;

        @ApiModelProperty(value = "安装次数")
        private Integer useTimes;

        @ApiModelProperty(value = "创建人")
        private String createUser;

        @ApiModelProperty(value = "创建时间")
        private String createTime;

        @ApiModelProperty(value = "发布到商城时间")
        private String shopTime;

        @ApiModelProperty(value = "是否能安装")
        private Boolean canInstall;

        @ApiModelProperty(value = "是否可以上架")
        private Boolean canShop;

        @ApiModelProperty(value = "页面树结构")
        private List<PageTree> pageTree;

        @ApiModelProperty(value = "是否超级管理员 true是 false不是")
        private Boolean adminFlag = true;

        @ApiModelProperty(value = "所有按钮权限ID")
        private List<String> btnAuths;
    }

    @Data
    @ApiModel("明细数据对象")
    public static class PageTree implements Serializable {

        @ApiModelProperty(value = "ID")
        private Integer id;

        @ApiModelProperty(value = "树节点ID")
        private Integer parentId;

        @ApiModelProperty(value = "页面类型 1-自定义 2-外部链接")
        private Integer pageType;

        @ApiModelProperty(value = "名称")
        private String name;

        @ApiModelProperty(value = "编码")
        private String encoding;

        @ApiModelProperty(value = "图标")
        private String icon;

        @ApiModelProperty(value = "外链地址")
        private String links;

        @ApiModelProperty("是否显示 0不显示 1显示")
        private Integer isShow;

        @ApiModelProperty(value = "页面树")
        private List<PageTree> children;

    }

    @Data
    public static class WebPageDTO implements Serializable {

        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        private Integer id;

        @ApiModelProperty("应用Id")
        private Integer appId;

        @ApiModelProperty("分组ID")
        private Integer groupId;

        @ApiModelProperty("页面类型 1-自定义 2-外部链接")
        private Integer pageType;

        @ApiModelProperty("外部链接页面地址")
        private String links;

        @ApiModelProperty("编码")
        private String encoding;

        @ApiModelProperty("图标")
        private String icon;

        @ApiModelProperty("名称")
        private String name;

        @ApiModelProperty("页面功能描述")
        private String comments;

        @ApiModelProperty("数据源ID")
        private Integer dsId;

        @ApiModelProperty("源码ID")
        private Integer sourceId;

        @ApiModelProperty("封面图片")
        private String coverUrl;

        @ApiModelProperty("是否显示 0不显示 1显示")
        private Integer isShow;

        @ApiModelProperty(value = "页面源码")
        private String sourceContent;

    }
}
